package com.example.demoexercise.controller.index;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.Arrays;


//在templates目录下的所有界面，只能通过controller来跳转
//需要模板引擎的支持
@Controller
public class indexController {
    @RequestMapping("/index")
    public String index(Model model){
        model.addAttribute("name","<h1>崔鹏</h1>");
        model.addAttribute("list", Arrays.asList("李猛","limeng","zhangyang"));
        return "index";
    }
}
